package org.zhxy.zhxy.controller.backend;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zhxy.zhxy.service.HomeService;
import org.zhxy.zhxy.utils.Result;

/**
 * 后台管理首页数据统计controller
 */
@RestController
@RequestMapping("/api/admin/home")
public class AdminHomeController {

    @Autowired
    private HomeService homeService;

    /**
     * 教室状态饼状图数据统计
     */
    @GetMapping("/statusChart")
    public Result statusChart(){
        return homeService.statusChart();
    }

    /**
     * 教室近5月申请数据统计
     */
    @GetMapping("/useChart")
    public Result useChart(){
        return homeService.useChart();
    }
}
